<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitUpdate26 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->integer('invite_level_score')->nullable()->comment('上级获得的成长值奖励');
            $table->json('invite_added_reward')->nullable()->comment('上级获得的额外奖励');
        });

        Schema::table('boxes', function (Blueprint $table) {
            $table->tinyInteger('presell_mode')->default(0)->comment('预售模式，0为预售前不可购买， 1为预售前可购买');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('invite_level_score');
            $table->dropColumn('invite_added_reward');
        });

        Schema::table('boxes', function (Blueprint $table) {
            $table->dropColumn('presell_mode');
        });
    }
}
